import { Card } from "../class/Card";
import { Context } from "../class/Context";
import { Method } from "../class/Method";
import { MethodFactory } from "../factory/MethodFactory";

/**
 * 从技能工厂里获得一个技能
 */
export class StudyMethodCard extends Card {
    static cardName = "学习"
    static description = "学习一个技能。"
    static random = 850
    public outHook(context: Context): void {
        const methodName = context.nextParam();

        const MethodClass = MethodFactory.getByName(methodName);// 从工厂获取技能类

        this.masterRole.addMethod(MethodClass);// 给角色添加技能
    }

}